package demo.access.modifier;

public class AbstractClass {
	public static void main(String[] args) {
		Parent pr = new Parent() {
			
			
			@Override
			void printAbstract() {
				System.out.println("Call abstract method parrent");
			}
		};
		pr.print();
		
		Child1 c1 = new Child1();
		c1.printAbstract();
		
		Child2 c2 = new Child2();
		c2.printAbstract();
	}
}

abstract class Parent
{
	abstract void printAbstract();
	
	public  void print()
	{
		printAbstract();
		System.out.println("Khong phai ham abstract");
	}
	
	
}

class Child1 extends Parent
{

	@Override
	void printAbstract() {
		System.out.println("Override abstract method: child 1");
	}
}


class Child2 extends Parent
{

	@Override
	void printAbstract() {
		System.out.println("Override abstract method: child 2");
	}
	
}